<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 fdm=marker: */

/**
 * LightBot
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category  LightBot
 * @package   LightBot
 * @copyright Copyright (c) 2008 Olivier Hoareau <hoareau.olivier@gmail.com>
 * @author    Olivier Hoareau <hoareau.olivier@gmail.com>
 * @license   License http://framework.zend.com/license   New BSD License
 * @version   $Id: ILightBot.php 43 2008-05-13 17:02:32Z hoareau.olivier $
 */

require_once dirname(__FILE__) . '/ILogger.php';
require_once dirname(__FILE__) . '/IListener.php';
require_once dirname(__FILE__) . '/IProtocolAdapter.php';
require_once dirname(__FILE__) . '/IActionAdapter.php';

// {{{ LightBot_ILightBot

/**
 * Light bot implementation
 *
 * @category  LightBot
 * @package   LightBot
 * @copyright Copyright (c) 2008 Olivier Hoareau <hoareau.olivier@gmail.com>
 * @author    Olivier Hoareau <hoareau.olivier@gmail.com>
 * @license   License http://framework.zend.com/license   New BSD License
 */
interface LightBot_ILightBot
{
    // {{{ configure()

    /**
     * Configures the Light bot with the specified configuration settings
     *
     * @param  mixed     $conf filename or array
     * @return LightBot  $this
     * @throws Exception if an error occured
     */
    public function configure($conf);

    // }}}
    // {{{ getProperty()

    /**
     * Returns the value of the specified property
     *
     * @param string $name the name of the property
     * @param string $default the default value
     * @return string the key value
     */
    public function getProperty($name,$default=null);

    // }}}
    // {{{ setActionAdapter()

    /**
     * Sets the action adapter
     *
     * @param LightBot_IActionAdapter $actionAdapter the action adapter
     * @return LightBot_ILightBot $this
     */
    public function setActionAdapter(LightBot_IActionAdapter $actionAdapter);

    // }}}
    // {{{ getActionAdapter()

    /**
     * Returns the action adapter
     *
     * @return LightBot_IAction the action adapter
     */
    public function getActionAdapter();

    // }}}
    // {{{ setProtocolAdapter()

    /**
     * Sets the underlying socket adapter
     * 
     * @param  LightBot_IProtocolAdapter $socketAdapter the socket adpater
     * @return LightBot                $this
     */
    public function setProtocolAdapter(LightBot_IProtocolAdapter $socketAdapter);

    // }}}
    // {{{ getProtocolAdapter()

    /**
     * Returns the underlying socket adapter
     *
     * @return LightBot_IProtocolAdapter the underlying socket adapter
     */
    public function getProtocolAdapter();

    // }}}
    // {{{ setListener()

    /**
     * Sets the underlying event listener
     * 
     * @param  LightBot_IListener $listener the event listener
     * @return LightBot           $this
     */
    public function setListener(LightBot_IListener $listener);

    // }}}
    // {{{ getListener()

    /**
     * Returns the underlying event listener
     *
     * @return LightBot_IListener the underlying event listener
     */
    public function getListener();

    // }}}
    // {{{ markStop()

    /**
     * Marks that the bot must stop as soon as possible
     *
     * @return LightBot $this
     */
    public function markStop();

    // }}}
    // {{{ run()

    /**
     * Runs the bot (listen)
     *
     * @return boolean   always true
     * @throws Exception if connection or execution error occured
     */
    public function run();

    // }}}
}

// }}}

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
